#!awk
BEGIN { FS="\""
	siteRoot="http://www.imagefap.com/"}

#BugFix pointed out by ShiningSun	
/gallery\.php\?pgid=.*&gid=[0-9]+&page=[0-9]+/ && /:: next ::/ {
	print siteRoot$2 }
